<script>
export default {
	onLaunch: function() {
		console.log('App Launch');
	},
	onShow: function() {
		console.log('App Show');
	},
	onHide: function() {
		console.log('App Hide');
	},
	mounted() {
		let THIS = this;
		// 扩展API加载完毕，现在可以正常调用扩展API
// 		plus.contacts.getAddressBook(
// 			plus.contacts.ADDRESSBOOK_PHONE,
// 			function(addressbook) {
// 				// 可通过addressbook进行通讯录操作
// 				addressbook.find(
// 					[],
// 					function(contacts) {
// 						for (let one of contacts) {
// 							console.log(JSON.stringify(one));
// 						}
// 					},
// 					function() {
// 						alert('error');
// 					},
// 					{ multiple: true }
// 				);
// 			},
// 			function(e) {
// 				alert('Get address book failed: ' + e.message);
// 			}
// 		);

		let selectedLang = uni.getStorageSync('selectedLang') || false;
		if (!selectedLang) {
			this.$store.state.actionsSheetOptions.push({
				show: true,
				title: '选择语言 Language',
				content: '请选择您惯用的语言.Please select your preferred language.',
				chanelText: '取消 Channel',
				allocatedClose: true,
				type: 'info',
				list: [
					{
						name: '英文 English',
						callBack: () => {
							THIS.$store.commit('setLang', 'en-US');
						}
					},
					{
						name: '中文 Chinese',
						callBack: () => {
							THIS.$store.commit('setLang', 'zh-CN');
						}
					}
				]
			});
		}
	}
};
</script>

<style lang="scss">
/*每个页面公共css */
@import './static/scss/list.scss';
@import './static/scss/btns.scss';
@import './static/css/iconfont.css';
.with-navbar {
	margin-top: var(--status-bar-height);
	padding-top: 100upx;
}

body,
html {
	background-color: rgb(250, 250, 250);
}

@font-face {
	font-family: myFirstFont;
	src: url('./static/fonts/tx.ttf');
}

body {
	font-family: myFirstFont;
}
</style>
